package org.diting.collections.samples;

import org.diting.collections.*;

public class Sample {
   public static void main() throws Exception
   {
	   int[] values = new int[] {0,1,2,3,4,5,6,7,8,9,10};
	   
	   Query<Integer> query = Queries.query(values)
			   .where(new Predicate<Integer>(){

		@Override
		public boolean evaluate(Integer value) throws Exception {
			return value % 2 == 0;
		}})
		.orderByDescending(new Selector<Integer, Integer>(){

			@Override
			public Integer select(Integer item) {
				return item;
			}});
	   
	   for(Integer i : query)
	   {
		   System.out.write(i);
		   System.out.write('\n');
	   }
	   
   }
}
